<? 
$row = 5;
$col = 3;
$col1=100/$col;

$cat = 0;
if($_REQUEST['cat']!='') $cat=killInjection($_REQUEST['cat']);

$p_new=0;
if ($_REQUEST['p_new']!='') $p_new=$_REQUEST['p_new'];
$sql = "select tbl_product.*,tbl_product_new.sort as sort from tbl_product_new,tbl_product where tbl_product_new.lang='".$_lang."' and tbl_product_new.product_id = tbl_product.id order by tbl_product_new.sort limit ".$row*$col*$p_new.",".$row*$col;
$result = @mysql_query($sql,$conn);
$total = countRecord("tbl_product_new","status=0 and lang='".$_lang."'");
if($total==0){
?>
<!--link href="../css/css.css" rel="stylesheet" type="text/css" /-->
<table cellspacing="4" cellpadding="0" width="100%" border="0">
	<tr><td height="10"></td></tr>
	<tr>
		<td align="center">
			<?=$_lang=="vn"?'Products are being updated !':'Products are being updated !'?><
		</td>
	</tr>
	<tr><td height="10"></td></tr>
</table>



<?
}else{
?>
	<table>
		<tr>
			<td>
				<p><font size="2" face="Candara, Verdana, Arial, Helvetica">
					<i style="color: rgb(51,51,255)">1. Our pharmacy <b>(Universal Pharmacy 
					Distributors Limited)</b> will not sell drugs or medication to anyone 
					under the age of 18 any order received which we believe to be from a 
					minor will not 
					be accepted &amp; refunded.<br>
			
					<br>
					2. <b>We only supply UK and European Customers</b>. We can&#39;t and won&#39;t 
					ship drugs to these countries due to licensing issues:</i></font></p>
					<p>&nbsp;</p>
					<p><i>
					<font face="Candara, Verdana, Arial, Helvetica" size="2" color="#3333FF">
					USA</font></i></p>
			
					<p><i>
					<font face="Candara, Verdana, Arial, Helvetica" size="2" color="#3333FF">
					Canada<br>
					South America</font></i></p>
					<p><i>
					<font face="Candara, Verdana, Arial, Helvetica" size="2" color="#3333FF">
					Rest of the World Outside of EU</font></i></p>
			
					<p>&nbsp;</p>
					<p><font size="2" face="Candara, Verdana, Arial, Helvetica">
					<i style="color: rgb(51,51,255)">Regards,</i></font></p>
					<p>&nbsp;</p>
					<p><i>
					<font face="Candara, Verdana, Arial, Helvetica" size="2" color="#3333FF">
					Site Administrator</font></i><font size="3" face="Candara, Verdana, Arial, Helvetica"><i style="color: rgb(51,51,255)"><br>
					</i></font><br />
				</p>
			</td>
		</tr>
	</table>
<table cellspacing="4" cellpadding="0" width="100%" border="0">
<?
for($i=0; $i<$row; $i++){
?>
	<tr>			  
			
<?
for($j=0; $j<$col&&$pro=mysql_fetch_assoc($result); $j++){				
	if($pro['image_large']!=''){
		$image=$pro['image_large'];
		}
		else{
		$image=$pro['image'];
		}
		//$size = getimagesize($image);
		//$height = $size[1]+50;
		//$width = $size[0]+20;
?>

	<td class="border_table"  valign="top">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" style="float:left">
				<tr>
				  <td height="40" colspan="2" align="center" valign="middle" bgcolor="#F4F4F4" >
				  	<a href="./?frame=product_detail&id=<?=$pro['id']?>" class="text_pro"><?=$pro['name']?> </a>
					
				</td>
				</tr>
						<?	
							$sql1 = "select * from tbl_product_category where id=".$pro['parent']." ";
							$result1 = @mysql_query($sql1,$conn);
							$pro1=mysql_fetch_assoc($result1); 

						?>				
				<tr valign="bottom">
				  <td colspan="2" align="center" height="40" >
						<A href="./?frame=product_detail&id=<?=$pro['id'];?>">
							<IMG src="<?=$pro1['image']; ?>" border=0 height="40px"/></A>
					  <DIV id=preview_div style="DISPLAY: none;  POSITION: absolute"></DIV>				  
				  </td>
				</tr>				
				<tr>
				  <td height="20" colspan="2" align="center"><span class="only">ONLY</span>: <span class="price"><strong>
					<? if ($pro['price']==0){
						echo "Contact Us";}
						else{
						//echo number_format($pro['price'],0,',','.');
						echo $pro['price'];
						echo '<span class="gbp">&nbsp;GBP</span></strong></span>';
						}
					?>
				  </strong></span> </td>
				</tr>
				<? if($pro['subject']!=0)
					{?>
					<tr><td align="center" style="padding:2px" colspan="2" height="20">
						 <?=$_lang=='vn' ? 'Promotion Price :' : 'Promotion Price : '?> 
						 <span class="red"><strong><?=$pro['subject']?>&nbsp;GBP</strong></span>
					</td>
					</tr>					
					<? }
					else {?>
						<tr><td align="center" style="padding:2px" colspan="2" height="2"></td></tr>
					<? }										
				?>				
				<tr>
				  <td align="center" height="25" style="padding-top:5px" valign="bottom" colspan="2"><a href="./?frame=cart&p=<?=$pro['id']?>" class="buynow">
				  	  <img src="images/cart.jpg" width="20" height="17" vspace="2" border="0" align="absmiddle" />&nbsp;&nbsp;Buy Now &nbsp;&nbsp;</a>
					  &nbsp;&nbsp;
					 
					  <a href="./?frame=product&cat=<?=$pro['parent']?>" class="buynow"><?=$_lang=='vn' ? 'More Info':'More Info'?> </a>	<br /><br /> </td>					 
				</tr>		
	  </table>
      <?
}
while($j<$col){
	echo "";
	$j=$j+1;
}
?></td>
	</tr>
	<? }?>
</table>

<? }?>
